#ifndef __BOUNDSI_H__
#define __BOUNDSI_H__

#include <wx/gdicmn.h>

struct Boundsi
{
	wxPoint Mins, Maxs;

	Boundsi(wxPoint mins, wxPoint maxs) :
		Mins(mins),
		Maxs(maxs)
	{
	}

	inline void AddPoint(wxPoint p)
	{
		if (p.x < Mins.x)
			Mins.x = p.x;
		if (p.y < Mins.y)
			Mins.y = p.y;

		if (p.x > Maxs.x)
			Maxs.x = p.x;
		if (p.y > Maxs.y)
			Maxs.y = p.y;
	}

	inline wxRect ToRectangle()
	{
		return wxRect(Mins.x, Mins.y, Maxs.x - Mins.x, Maxs.y - Mins.y);
	}
};

#endif